Add Google ADK generative-UI chat example#755
Merged
Conversation
Adds examples/google-adk: a Next.js app that wires a Google Agent Development Kit (ADK, TypeScript) agent to OpenUI's generative UI frontend, alongside the existing mastra-chat / langgraph-chat agent examples. What it demonstrates - A Google ADK `Agent` with a `FunctionTool` (weather) running in a Next.js API route via `Runner` + `InMemorySessionService`, with ADK sessions keyed by chat `threadId` so multi-turn history is preserved. - Bridging ADK's `runAsync` SSE event stream into OpenAI-style chat-completion chunks so OpenUI's `openAIAdapter()` can parse them (partial events are streamed as deltas; the final aggregated event is skipped to avoid duplication). - Rendering the streamed OpenUI Lang with `<AgentInterface />` and the built-in `openuiChatLibrary`. The agent is prompted with OpenUI's generated system prompt so replies are OpenUI Lang. Notes for reviewers - Requires a Gemini API key (GEMINI_API_KEY) in .env.local; free key at https://aistudio.google.com/apikey. - pnpm-lock.yaml gains the examples/google-adk importer plus @google/adk's dependency tree. The install was regenerated from the committed lockfile so only google-adk's footprint and the unavoidable shared peer-hash ripple (it pulls `encoding` into the hoisted graph) change; no other example's importer block is touched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vishxrad
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds
examples/google-adk: a Next.js app that wires a Google Agent Development Kit (ADK, TypeScript) agent to OpenUI's generative UI frontend — alongside the existingmastra-chat/langgraph-chatagent examples.What it demonstrates
Agentwith aFunctionTool(weather) running in a Next.js API route viaRunner+InMemorySessionService, with ADK sessions keyed by chatthreadIdso multi-turn history is preserved.runAsyncSSE event stream is translated into OpenAI-style chat-completion chunks so OpenUI'sopenAIAdapter()can parse them. Partial events stream as deltas; the final aggregated event is skipped to avoid duplication.<AgentInterface />and the built-inopenuiChatLibrary. The agent is prompted with OpenUI's generated system prompt (src/generated/system-prompt.txt) so its replies are OpenUI Lang.How to run
Verification
tsc --noEmit✓,next build✓GET /→ 200;POST /api/chatstreamstext/event-streamin the exact chunk shapeopenAIAdapter()expects. ADK logs confirm it created the user event and issued a streaminggemini-flash-latestrequest. (Model call only fails on a placeholder key — the route catches it and closes the stream cleanly.)Notes for reviewers
pnpm-lock.yamlgains theexamples/google-adkimporter plus@google/adk's dependency tree. The install was regenerated from the committed lockfile so only google-adk's footprint and the unavoidable shared peer-hash ripple (it pullsencodinginto the hoisted graph) change — no other example's importer block is touched, and there are no orphaned removals (just two trivial transitive bumps:@emnapi/runtimeand apostcsspatch underautoprefixer).🤖 Generated with Claude Code